﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:settings="clr-namespace:MishraReader.Views.Settings"
                    xmlns:mr="http://mishrareader.codeplex.com/Reader"
                    xmlns:platformVMs="clr-namespace:MishraReader.PlatformVMs"
                    xmlns:mishraReader="clr-namespace:MishraReader;assembly=MishraReader.ViewModels">
    
    <DataTemplate DataType="{x:Type platformVMs:SettingsViewModel}" x:Key="optionsTabSettings">
        <mr:AnimatedTabControl Style="{StaticResource LeftTabControl}" 
                                 SelectedIndex="{Binding SelectedTabIndex}">

            <TabItem Style="{StaticResource LeftTabItem}" Header="{x:Static mishraReader:Strings.Accounts}" >
                <settings:AccountTabItem />
            </TabItem>

            <TabItem Style="{StaticResource LeftTabItem}" Header="{x:Static mishraReader:Strings.Option_ShareServices}" >
                <settings:ShareServicesTabItem />
            </TabItem>

            <TabItem Style="{StaticResource LeftTabItem}" Header="{x:Static mishraReader:Strings.Option_BookmarkServices}" >
                <settings:BookmarkServicesTabItem />
            </TabItem>

            <TabItem Style="{StaticResource LeftTabItem}" Header="{x:Static mishraReader:Strings.Display}" >
                <settings:DisplayTabItem />
            </TabItem>

            <TabItem Style="{StaticResource LeftTabItem}" Header="{x:Static mishraReader:Strings.Network}" >
                <settings:NetworkTabItem />
            </TabItem>
        </mr:AnimatedTabControl>
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type platformVMs:SettingsViewModel}" x:Key="aboutTab">
        <mr:AnimatedTabControl Style="{StaticResource LeftTabControl}">

            <TabItem Style="{StaticResource LeftTabItem}" Header="{x:Static mishraReader:Strings.WhatsNewBig}" >
                <settings:WhatsNewTabItem />
            </TabItem>

            <TabItem Style="{StaticResource LeftTabItem}" Header="{x:Static mishraReader:Strings.TeamBig}" >
                <settings:TeamTabItem />
            </TabItem>
        </mr:AnimatedTabControl>
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type platformVMs:SettingsViewModel}">
        <Grid Margin="40,0,40,20">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <mr:AnimatedListBox 
                Style="{DynamicResource HorizontalMenuListBox}" 
                ItemsSource="{Binding Headers}"
                SelectedIndex="{Binding SelectedHeaderIndex, Mode=TwoWay}"  
                Margin="0,15,0,30" />

            <ContentPresenter Content="{Binding}" Grid.Row="1" ContentTemplate="{StaticResource optionsTabSettings}"
                    TextOptions.TextFormattingMode="Display"                    
                    x:Name="contentPart" 
                    Margin="-10,0,0,20" />

            <UniformGrid TextOptions.TextFormattingMode="Display"
            Grid.Row="2" HorizontalAlignment="Right" Columns="2" Grid.Column="1">
                <Button Content="{x:Static mishraReader:Strings.SaveChanges}" Command="{Binding OkCommand}" IsDefault="True" Margin="15,0,0,0"/>
                <Button Content="{x:Static mishraReader:Strings.Cancel}" Command="{Binding CancelCommand}" IsCancel="True" Margin="15,0,0,0"/>
            </UniformGrid>

        </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding SelectedHeaderIndex}" Value="1">
                <Setter TargetName="contentPart" Property="ContentTemplate" Value="{StaticResource aboutTab}" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
</ResourceDictionary>